#include<stdio.h>

long MaxYueShu(long fenzi, long fenmu); //求分子和分母的最大公约数

int main()
{
    long fenzi[101] = {0}, fenmu[101] = {0};
    int n;
    long sum_fenzi = 0, part_fenzi = 1, total_fenmu = 1;
    long max_yueshu_1 = 1, max_yuehsu_2 = 1;// _1是没有整数部分时的约数， _2是有整数部分时，余数之间的约数
    scanf("%d", &n);
    for(int i = 0; i < n; i++)
    {
        scanf("%ld/%ld", &fenzi[i], &fenmu[i]);
        total_fenmu *= fenmu[i];
    }
    for(int j = 0; j < n; j++)
    {
        part_fenzi = fenzi[j];
        for(int k = 0; k < n; k++)
        {
            if(j == k)continue;
            part_fenzi *= fenmu[k];
        }
        sum_fenzi += part_fenzi;
    }
    //以上为 输入以及求和部分； 以下为约分及输出部分

    if(sum_fenzi / total_fenmu == 0)
    {
        max_yueshu_1 = MaxYueShu(sum_fenzi, total_fenmu); //求最大公约数
        sum_fenzi = sum_fenzi / max_yueshu_1;
        total_fenmu = total_fenmu / max_yueshu_1;
        printf("%ld/%ld", sum_fenzi, total_fenmu);
    }
    else if(sum_fenzi % total_fenmu == 0)
    {
        printf("%ld", sum_fenzi / total_fenmu);
    }
    else
    {
        max_yuehsu_2 = MaxYueShu(sum_fenzi % total_fenmu, total_fenmu);
        printf("%ld %ld/%ld", sum_fenzi / total_fenmu, (sum_fenzi % total_fenmu) / max_yuehsu_2, total_fenmu / max_yuehsu_2);
    }
    
    return 0;
}

long MaxYueShu(long fenzi, long fenmu)
{
    long max_yueshu = 1;
    for(long i = 1; i <= fenzi; i++)
    {
        if(fenzi % i == 0 && fenmu % i == 0)
        {
            max_yueshu = i;
        }
    }
    return max_yueshu;
}
